<?php
class Application_Model_Areas extends Zend_Db_Table_Abstract
{
    protected $_name ='area';
    protected $_primary ='id_area';
    
    public function getAll()
    {
        return $this->fetchAll();
    }
    public function save($bind, $id=null)
    {
        if(is_null($id)){
            $row=$this->createRow();
        }else{
            $row=$this->getRow($id);
        }
      
        $row->nombre_area=$bind['nombre_area'];
        $row->nivel=$bind['nivel'];
        return $row->save(); 
    }
    public function getRow($id_area){
        $id_area=(int)$id_area;
        $row=$this->find($id_area)->current();
        return $row;
    }
}